<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // window.alert(111)
        // let flag = confirm('确定删除吗？')
        // console.log(flag)

        function doOpen(){
            window.open('https://www.baidu.com', 'wanho', 'width=500,height=500')
        }

        var timer 
        
        function doStart(){
            // 开启一个计时器
            // timer = setTimeout(function(){
            //     console.log('爆炸。。。。。')
            // }, 5000)

            timer = setInterval(function(){
                console.log('爆炸。。。。。')
            }, 1000)
        }

        function doStop(){
            // clearTimeout(timer)
            clearInterval(timer)
            console.log('停止')
        }

        function doLocation(){
            // console.log(location.href)

            // location.href = 'http://www.qq.com'

            location.reload()
        }

        function doHistory(){
            // history.back()
            history.forward()
        }
    </script>
</head>
<body>
    <button onclick="doOpen()">打开一个新窗口</button>
    <button onclick="doStart()">开始计时器</button>
    <button onclick="doStop()">停止计时器</button>
    <button onclick="doLocation()">操作location</button>
    <button onclick="doHistory()">操作history</button>
</body>
</html>